import { getCategory } from "@/api/system/category";

const useCategoryStore = defineStore("category", {
  state: () => ({
    xlList: [],
    zcgsdwList: [],
    zcList: [],
    xmlyList: [],
    zzlbList: [],
    cbdwjbList: [],
    kjxkflList: [],
    skxkflList: [],
    cdjsList: [],
    yyList: [],
    fbfwList: [],
    lwlx: [],
    cndxList: [],
    yjxkList: [],
    jdjgList: [],
    wcxsList: [],
    zplxList: [],
    zzqlxList: [],
    sshyList: [],
    bzsxList: [],
    bznbList: [],
    yzflList: [],
    zllxList: [],
    xwList: [],
    zlztList: [],
    hzlxList: [],
    zlfwList: [],
    gjdqList: [],
    sdjbList: [],
    hjjbList: [],
    hjdjList: [],
    hjnbList: [],
    zzlxList: [],
    zzmcList: [],
    shztList: [],
    hjztist: [],
    rychList: [],
    hylxList: [],
    jzlxList: [],
    jzjbList: [],
    sbztList: [],
    hjztList: [],
    sllb: [],
    sllb1: [],
    sllb2: [],
    zscqList: [],
    manifestationIdList: [],
    matureIdList: [],
    advancedIdList: [],
    domainIdList: [],
    obtainIdList: [],
    supportIdList: [],
    transforIdList: [],
    lwzzList: [],
    sydwList: [], //人员列表这里需要改成传所有单位
  }),
  actions: {
    getxlList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "学历",
        };
        getCategory(parms)
          .then((res) => {
            this.xlList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzcgsdwList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "成果归属单位",
        };
        getCategory(parms)
          .then((res) => {
            this.zcgsdwList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzcList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "职称",
        };
        getCategory(parms)
          .then((res) => {
            this.zcList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getxmlyList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "项目来源",
        };
        getCategory(parms)
          .then((res) => {
            this.xmlyList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzzlbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "著作类别",
        };
        getCategory(parms)
          .then((res) => {
            this.zzlbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getcbdwjbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "出版单位级别",
        };
        getCategory(parms)
          .then((res) => {
            this.cbdwjbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getkjxkflList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "一级学科",
          valueCascade: "2",
        };
        getCategory(parms)
          .then((res) => {
            this.kjxkflList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getskxkflList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "一级学科",
          valueCascade: "1",
        };
        getCategory(parms)
          .then((res) => {
            this.skxkflList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getcdjsList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "承担角色-著作",
        };
        getCategory(parms)
          .then((res) => {
            this.cdjsList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getyyList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "外语",
        };
        getCategory(parms)
          .then((res) => {
            this.yyList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getfbfwList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "发表范围",
        };
        getCategory(parms)
          .then((res) => {
            this.fbfwList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getlwlx() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "论文类型",
        };
        getCategory(parms)
          .then((res) => {
            this.lwlx = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getcndxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "采纳对象",
        };
        getCategory(parms)
          .then((res) => {
            this.cndxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getyjxkList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "一级学科",
        };
        getCategory(parms)
          .then((res) => {
            this.yjxkList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getjdjgList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "鉴定结论",
        };
        getCategory(parms)
          .then((res) => {
            this.jdjgList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getwcxsList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "完成形式",
        };
        getCategory(parms)
          .then((res) => {
            this.wcxsList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzplxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "作品类型",
        };
        getCategory(parms)
          .then((res) => {
            this.zplxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzzqlxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "著作权类型",
        };
        getCategory(parms)
          .then((res) => {
            this.zzqlxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsshyList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "国民经济行业",
        };
        getCategory(parms)
          .then((res) => {
            this.sshyList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getbzsxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "标准属性",
        };
        getCategory(parms)
          .then((res) => {
            this.bzsxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getbznbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "标准类别",
        };
        getCategory(parms)
          .then((res) => {
            this.bznbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getyzflList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "药证分类",
        };
        getCategory(parms)
          .then((res) => {
            this.yzflList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzllxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "专利类型",
        };
        getCategory(parms)
          .then((res) => {
            this.zllxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getxwList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "学位",
        };
        getCategory(parms)
          .then((res) => {
            this.xwList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzlztList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "专利状态",
        };
        getCategory(parms)
          .then((res) => {
            this.zlztList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethzlxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "合作类型",
        };
        getCategory(parms)
          .then((res) => {
            this.hzlxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzlfwList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "专利范围",
        };
        getCategory(parms)
          .then((res) => {
            this.zlfwList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getgjdqList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "国家地区",
        };
        getCategory(parms)
          .then((res) => {
            this.gjdqList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsdjbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "审定级别",
        };
        getCategory(parms)
          .then((res) => {
            this.sdjbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethjjbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "获奖级别",
        };
        getCategory(parms)
          .then((res) => {
            this.hjjbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethjdjList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "获奖等级",
        };
        getCategory(parms)
          .then((res) => {
            this.hjdjList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethjnbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "奖励类别",
        };
        getCategory(parms)
          .then((res) => {
            this.hjnbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzzlxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "转载类型",
        };
        getCategory(parms)
          .then((res) => {
            this.zzlxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzzmcList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "论文转载名称",
        };
        getCategory(parms)
          .then((res) => {
            this.zzmcList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getshztList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "流程实例状态",
        };
        getCategory(parms)
          .then((res) => {
            this.shztList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethjztist() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "获奖状态",
        };
        getCategory(parms)
          .then((res) => {
            this.hjztist = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getrychList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "荣誉称号",
        };
        getCategory(parms)
          .then((res) => {
            this.rychList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethylxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "会议类型",
        };
        getCategory(parms)
          .then((res) => {
            this.hylxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getjzlxList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "讲座类型",
        };
        getCategory(parms)
          .then((res) => {
            this.jzlxList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getjzjbList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "讲座级别",
        };
        getCategory(parms)
          .then((res) => {
            this.jzjbList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsbztList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "申报状态",
        };
        getCategory(parms)
          .then((res) => {
            this.sbztList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    gethjztList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "奖励状态",
        };
        getCategory(parms)
          .then((res) => {
            this.hjztList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsllb() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "收录类别",
        };
        getCategory(parms)
          .then((res) => {
            this.sllb = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsllbE1() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "收录类别",
          valueCascade: "1",
        };
        getCategory(parms)
          .then((res) => {
            this.sllb1 = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsllbE2() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "收录类别",
          valueCascade: "2",
        };
        getCategory(parms)
          .then((res) => {
            this.sllb2 = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getzscqList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "知识产权类型",
        };
        getCategory(parms)
          .then((res) => {
            this.zscqList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getManifestationIdList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "成果体现形式",
        };
        getCategory(parms)
          .then((res) => {
            this.manifestationIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getMatureIdList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "技术成熟度",
        };
        getCategory(parms)
          .then((res) => {
            this.matureIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getAdvancedIdList() {
      //技术成熟度
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "鉴定结论",
        };
        getCategory(parms)
          .then((res) => {
            this.advancedIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getDomainIdList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "所属高新技术领域",
        };
        getCategory(parms)
          .then((res) => {
            this.domainIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getObtainIdList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "合作形式",
        };
        getCategory(parms)
          .then((res) => {
            this.obtainIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getSupportIdList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "获得政府支持情况",
        };
        getCategory(parms)
          .then((res) => {
            this.supportIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getTransforIdList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "拟采取转化方式",
        };
        getCategory(parms)
          .then((res) => {
            this.transforIdList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getlwzzList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "论文作者-角色类型",
        };
        getCategory(parms)
          .then((res) => {
            this.lwzzList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
    getsydwList() {
      return new Promise((resolve, reject) => {
        let parms = {
          bizName: "所有单位",
        };
        getCategory(parms)
          .then((res) => {
            this.sydwList = res.data;
            resolve(res);
          })
          .catch((error) => {
            reject(error);
          });
      });
    },
  },
});

export default useCategoryStore;
